The present invention relates to an encipher method to encipher a plaintext and to a decipher method to decipher the ciphertext made by the encipher method.
As conventional typical encipher algorithms, the DES algorithm (Data Encryption Algorithm) and the FEAL algorithm (Fast Encryption Standard) have been known. The DES algorithm has been described in detail in, for instance, (1) Koyama et al., "Modern Theory of Encryption", The Institute of Electronics and Communication Engineers of Japan, pages 41 to 49, September 1986. On the other hand, the FEAL algorithm has been described in detail in, (2) Shimizu et al., "Fast Data Encipherment Algorithm FEAL", Papers of the Institute of Electronics and Communication Engineers of Japan, D. Vol. J70-D, No. 7, pages 1413 to 1423, July 1987.
The nonlinear calculation part in the DES process, that is, the process which is called an S (Substitution) box will now be described.
First, in accordance with the DES, algorithm data R (r.sub.1, r.sub.2, . . . , r.sub.32) of, for instance, lower 32 bits in an input plaintext of 64 bits is magnified into data R' of 48 bits by an extensional permutation table shown in FIG. 11.
As shown in FIG. 12, the magnified data R' comprises eight blocks B.sub.1 to B.sub.8 each consisting of six bits.
The data R of 32 bits is divided every four bits. One bit is added before and after the data of four bits. In this manner, each of the blocks (B.sub.1 to B.sub.8) is constructed by total six bits.
According to the extensional permutation table shown in FIG. 11, as the bits to be added, for instance, as shown by r.sub.4 and r.sub.9 in block B.sub.2 in FIG. 12, the bit (r.sub.4) just before the first bit (r.sub.5) of the data (bits r.sub.5 to r.sub.8) obtained by dividing the data R of 32 bits every four bits and the bit (r.sub.9) just after the last bit (r.sub.8) of the data (bits r.sub.5 to r.sub.8) are used.
The exclusive OR operation of the data R' of 48 bits obtained as mentioned above and encipher key data K of 48 bits is calculated, thereby converting the data R' into data R" of 48 bits.
Next, the data R" is divided into eight blocks (B'.sub.1 to B'.sub.8) each consisting of six bits. The eight blocks are inputted to eight S boxes (or called selection functions) S.sub.1 to S.sub.8, respectively.
Each of the S boxes (S.sub.1 to S.sub.8) has the function for receiving the data of six bits and outputting the data of four bits.
FIG. 13 is a diagram showing a substitution table of the foregoing S box (S.sub.1).
The S box (S.sub.1) shown in the diagram includes four kinds of substitution tables (substitution table numbers [00] to [11]).
When the 6-bit data of the data R" is inputted to the S box (S.sub.1), the S box (S.sub.1) selects one of the four substitution tables in accordance with the first and last bits of the input 6-bit data.
For instance, in the case where data whose bit pattern is indicated by "011011" is used as the input 6-bit data, the S box (S.sub.1) selects the substitution table indicated by the bit train "01" comprising a combination of the first bit "0" and the last bit "1" in the data, that is, indicated by the substitution table number [01].
Next, when the central four bits "1101" of the input data are converted into the decimal number, it becomes "13". Therefore, the value "5". indicated by the column 13 of the substitution table "01", that is, "0101" of the binary number is outputted as output data of four bits.
The input data R (r.sub.1, r.sub.2, . . . , r.sub.32) is encrypted by executing the above processes of the S box (S.sub.1) with respect to the other S boxes (S.sub.2 to S.sub.8).
In accordance the DES algorithm, by repeating the foregoing processes including the S boxes sixteen times, the plaintext data of 64 bits is finally converted into the ciphertext data of 64 bits.
As shown in the example of the processes mentioned above, the DES algorithm executes the processes of a single bit unit fundamentally.
The nonlinear calculation part in the FEAL process will now be described.
In accordance the FEAL algorithm, for instance, the data R (r.sub.1, r.sub.2, . . . , r.sub.32) of lower 32 bits in the input plaintext data of 64 bits is first divided into four block data (.alpha..sup.0, .alpha..sup.1, .alpha..sup.2, .alpha..sup.3) every eight bits.
Next, by calculating the exclusive OR of each of the block data and the encipher key data (.alpha..sub.0 to .beta..sub.3) of eight bits, the block data is respectively converted into intermediate data (.gamma..sup.0, .gamma..sup.1, .gamma..sup.2, .gamma..sup.3). Thereafter, the processes by the following function S are executed.
The function S is the function shown by the equation EQU S(x.sub.1 +x.sub.2 +.delta.)=Rot.sub.2 (w)
where,
w=(x.sub.1 +x.sub.2 +.delta.) mod 256 PA1 .delta.=0 or 1 (constant)
The intermediate data .gamma..sup.0 to .gamma..sup.3 or the 8-bit data obtained as the result of the processes by the function S are inputted as x.sub.1 and x.sub.2. On the other hand, the function Rot.sub.2 (w) denotes the process to circulate and shift the data w by two bits to the upper or lower bit side.
In accordance with the FEAL algorithm, further, by repeating the foregoing processes eight times for the data obtained as the result of the processes by the function S, the plaintext data of 64 bits is finally converted into the ciphertext data of 64 bits. As shown in the above processes, in the FEAL algorithm, the processes are fundamentally executed in a 8-bit unit basis.